/*
 * Copyright (c) 2021. Moses All Right Reserved
 */

package com.moses.design_patterns.iterator;

import java.util.LinkedList;
import java.util.List;

/**
 * @author Moses
 * @email shenhuohui@gmail.com
 * @date 2021/4/16 22:26
 */
public class Container implements IContainer {
    List<Project> projects = new LinkedList<>();
    @Override
    public void add(Project project) {
        projects.add(project);
    }

    @Override
    public void remove(int index) {
        projects.remove(index);
    }

    @Override
    public IIterator iterator() {
        return new ProjectIterator(projects);
    }
}
